<html>
<head>
<script type="text/javascript" src="<?php echo base_url()?>js/jquery.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>js/jquery-ui.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>js/jquery-confirm.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>css/jquery-ui.css"/>

<script type="text/javascript">
$(document).ready(function() {

$(".xdelete a").easyconfirm({locale: {
		title: 'Delete place',
		text: 'Do you want to delete this place?',
		button: ['No',' Yes'],
		closeText: 'x'
	}});
$('.xdelete a').click(function() 
	{
		var item = $(this);
		
			$.ajax({
				type: "POST",
			 	url: "place/delete_place",
			  	data: $.param({idpost:item.attr("del_id")}),
			 	cache: false,
			 	success: function(html){
			 		$("#row_"+item.attr("del_id")).slideUp('slow', function() {$(this).remove();});
			 	}
			});
		return false;
	});
});
</script>
</head>
<body onload="initialize()">
<div id="wrapper">
<div id="wrapper3">
		<div id="onecolumn">
		
			<div id="kotakphoto3"><h1>Favorite Places</h1></div>
			<div class="addmap"><?php echo anchor('place/add_map_place/','Add Place');?></div>
			<?php echo $this->load->view('place/map_indexasli')?>
			<div class="menuplace">
				<div id="kotakphoto4">New Places<?php echo anchor('place/see_all_place','see all places');?></div>
				<ol style="list-style-type:none" id="update" class="timeline">
				<?php foreach($data as $row):?>
				<li id="row_<?php echo $row->id_place;?>">
				<div id="newplace">
				<?php echo '<div class="newplacename">'.anchor('place/view/'.$row->id_place,$row->name).'</div>';?>
				<?php if ($row->id_user == $this->session->userdata('id_user')){
							echo '<div class="xdelete"><a href="#" del_id="'.$row->id_place.'"  >x</a></div>';
						}else if ($this->session->userdata('id_user') == 1 ){
							echo '<div class="xdelete"><a href="#" del_id="'.$row->id_place.'"  ><span style="color:red"><b>x</b></span></a></div>';
						}else{
							echo '';
						}
				
				echo '<div class="desc2">'.$row->description.'</div>';
				?>
				</div>
				</li>
				<?php endforeach?>
				</ol>
				</div>
			
			
			
		</div>
</div>
</div>
</body>
</html>